// 传入普通值
Promise.resolve('abc').then(res => {
  console.log(res)
})

// 传入promise
var promiser = new Promise(function (resolve, reject) {
  resolve(100)
})
var promiser2 = Promise.resolve(promiser);
console.log(promiser === promiser2);// true

// then用法
Promise.resolve({
  then: function (onFulfilled, onRejected) {
    onFulfilled('foo')
  }
}).then(res => {
  console.log(res)
})


Promise.reject('def').catch(error => {
  console.log(error)
})